package com.chinasoft.book.app;

import com.chinasoft.book.service.BookService;
import com.chinasoft.book.service.impl.BookServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringIocMain {
    public static void main(String[] args) {

        // 获取 IOC 容器  HashMap
        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");

        // 从容器里面 获取 实例对象  bean
        BookService bookService = (BookService) ac.getBean("bookService");
//        BookService bookService = new BookServiceImpl();

        bookService.queryBook();

    }
}
